<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			#btn{
				color: blue;
				position: fixed;
				width: 100px;
				top: 500px;
			}
		</style>
	</head>
	<body style="height: 2000px;">
		<button type="button" id="btn">回到顶部</button>
		
		
	</body>
	<script type="text/javascript">
		 var btn = document.getElementById('btn')
		 btn.onclick = function(){
			 window.scrollTo(0,100);//表示回到据顶部100px的位置
		 }
		
	</script>
</html>
